package demo1;

import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: ASUS
 * Date: 2023-10-16
 * Time: 17:49
 */
public class Test4 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        for (int i = 30; i >= 0; i-=2) {
            System.out.print(((n>>i) & 1) + " ");
        }
        System.out.println();
        for (int i = 31; i >= 1; i -=2) {
            System.out.print(((n>>i) & 1) + " ");
        }
    }
}
